package com.itheima.mapper.admin;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.itheima.domian.Dish;
import com.itheima.domian.Setmeal;
import com.itheima.domian.vo.QueryVo;
import com.itheima.domian.vo.QueryVo2;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @Author 12441
 * @Date 2022/8/11 15:11
 * @Version 1.0
 */
@Mapper
public interface SetmealMapper extends BaseMapper<Setmeal> {
    @Select("SELECT setmeal.id as id, type,category_id as categoryId,setmeal.name as name,\n" +
            "    price,setmeal.code, image,setmeal.status,\n" +
            "    setmeal.update_time as updateTime ,category.name as categoryName\n" +
            "    FROM setmeal join category on setmeal.category_id = category.id")
    IPage<QueryVo2> findByPage(IPage<QueryVo2> page, @Param(Constants.WRAPPER) QueryWrapper<QueryVo2> wrapper);


}
